package cn.iocoder.yudao.module.biz.controller.admin.company.service.impl;

import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
import cn.iocoder.yudao.module.biz.controller.admin.invoice.domain.SanBizInvoiceManagement;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.iocoder.yudao.module.biz.controller.admin.company.domain.SanBizCompanyInfo;
import cn.iocoder.yudao.module.biz.controller.admin.company.service.SanBizCompanyInfoService;
import cn.iocoder.yudao.module.biz.controller.admin.company.mapper.SanBizCompanyInfoMapper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
* @author 王兴鹏
* @description 针对表【san_biz_company_info(公司信息表)】的数据库操作Service实现
* @createDate 2025-09-15 15:51:56
*/
@Service
public class SanBizCompanyInfoServiceImpl extends ServiceImpl<SanBizCompanyInfoMapper, SanBizCompanyInfo>
    implements SanBizCompanyInfoService{

    @Resource
    private SanBizCompanyInfoMapper mapper;

    @Override
    public IPage<SanBizCompanyInfo> getPage(SanBizCompanyInfo pageReqVO) {
        QueryWrapper queryWrapper = new QueryWrapper();
        PageParam pageParam = new PageParam();
        pageParam.setPageNo(pageReqVO.getPageNo());
        pageParam.setPageSize(pageReqVO.getPageSize());
        if(StringUtils.isNotEmpty( pageReqVO.getCompanyName())){
            queryWrapper.eq("company_name", pageReqVO.getCompanyName());
        }
        if(StringUtils.isNotEmpty( pageReqVO.getBankAccount())){
            queryWrapper.eq("bank_account", pageReqVO.getBankAccount());
        }
        queryWrapper.eq("type", pageReqVO.getType());
        queryWrapper.orderByDesc("create_time");
        IPage<SanBizCompanyInfo> mpPage = MyBatisUtils.buildPage(pageParam);
        return mapper.selectPage(mpPage, queryWrapper);
    }
}




